home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / xcmd / dialog20.sit / Dialog's stack 2.0 (US) / card_2972.txt < prev    next >
Text File  |  1989-06-09  |  24KB  |  676 lines

  1. -- card: 2972 from stack: in.0 (US)
  2. -- bmap block id: 2124
  3. -- flags: 0000
  4. -- background id: 2660
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on attente
  8.   repeat
  9.     get HandleDialog(505)
  10.     if it is 1 then exit repeat
  11.     if the optionkey is down then exit repeat
  12.   end repeat
  13.   disDialog 505
  14. end attente
  15.  
  16.  
  17. -- part 1 (field)
  18. -- low flags: 81
  19. -- high flags: 0007
  20. -- rect: left=143 top=0 right=342 bottom=512
  21. -- title width / last selected line: 0
  22. -- icon id / first selected line: 0 / 0
  23. -- text alignment: 0
  24. -- font id: 4
  25. -- text size: 9
  26. -- style flags: 0
  27. -- line height: 12
  28. -- part name: help
  29.  
  30.  
  31. -- part 2 (button)
  32. -- low flags: 00
  33. -- high flags: A002
  34. -- rect: left=22 top=24 right=46 bottom=122
  35. -- title width / last selected line: 0
  36. -- icon id / first selected line: 0 / 0
  37. -- text alignment: 1
  38. -- font id: 0
  39. -- text size: 12
  40. -- style flags: 0
  41. -- line height: 16
  42. -- part name: Let's try
  43. ----- HyperTalk script -----
  44. on mouseUp
  45.   if the visible of cd fld 1 is true then
  46.     set the scroll of cd fld 1 to 0
  47.     exit to hypercard
  48.   end if
  49.  
  50.   put "5,6,7,8,9" into RadBtn
  51.   put "10,11" into ChkBtn
  52.   put false into Gray
  53.   put false into Hidden
  54.   put false into Hy
  55.  
  56.   ModDialog 500,geneva,9,H
  57.   if the result is not empty then exit to hypercard
  58.   ModifyItem 500,21,2
  59.   -- Select the first radio-control
  60.   SetDialog 500,5,1
  61.   repeat
  62.     get HandleDialog(500)
  63.     put it into UserClic
  64.     if userClic is 1 then
  65.       exit repeat
  66.     else if UserClic is 2 then
  67.       -- Cancel
  68.       exit repeat
  69.     else if userClic is 12 then
  70.       -- others...
  71.     else if UserCLic is in RadBtn then
  72.       -- user clicked in one of the radio-controls
  73.       -- first, set all buttons to unhilight;
  74.       repeat with i is 5 to 9
  75.         SetDialog 500,i,0
  76.       end repeat
  77.       -- then hilite the button which was selected;
  78.       SetDialog 500,UserClic,1
  79.     else if UserClic is in ChkBtn then
  80.       -- User clicked in one of the check-boxes
  81.       -- Test if the check-box clcicked is currently selectedΓǪ
  82.       if (item 1 of DialogValue(500,UserClic)) = 1 then
  83.         SetDialog 500,UserClic,0
  84.       else
  85.         SetDialog 500,UserClic,1
  86.       end if
  87.     else if UserClic is 18 then
  88.       if hidden is false then
  89.         ModifyItem 500,20,2
  90.         put true into Hidden
  91.         setDialog 500,18,"<< Show test item"
  92.       else
  93.         ModifyItem 500,20,1
  94.         put false into Hidden
  95.         setDialog 500,18,"<< Hide test item"
  96.       end if
  97.     else if UserClic is 19 then
  98.       if not Gray then
  99.         ModifyItem 500,20,3
  100.         put true into Gray
  101.         SetDialog 500,19,"<< Hilight test item"
  102.       else
  103.         ModifyItem 500,20,4
  104.         put false into Gray
  105.         SetDialog 500,19,"<< Unhilight test item"
  106.       end if
  107.     else if UserClic is 17 then
  108.       repeat with i is 1 to 100
  109.         SetDialog 500,13,i
  110.       end repeat
  111.       wait 30 ticks
  112.       SetDialog 500,13,0
  113.     else if UserClic is 16 then
  114.       if not Hy then
  115.         ModiFyItem 500,21,1
  116.         put true into Hy
  117.         SetDialog 500,16,"!!"
  118.       else
  119.         ModifyItem 500,21,2
  120.         put false into Hy
  121.         SetDialog 500,16,"?"
  122.       end if
  123.     end if
  124.   end repeat
  125.   if UserClic is 1 then Get_Result
  126.   DisDialog 500
  127. end mouseUp
  128.  
  129. on Get_result
  130.   -- Now, take a look to the choices the user made
  131.   put false into Chk1
  132.   put false into Chk2
  133.   repeat with i is 5 to 9
  134.     if item 1 of DialogValue(500,i) is 1 then
  135.       put i into RadBtnChoosen
  136.       exit repeat
  137.     end if
  138.   end repeat
  139.   -- the checkboxesΓǪ
  140.   if item 1 of DialogValue(500,10) is 1 then put true into Chk1
  141.   if item 1 of dialogValue(500,11) is 1 then put true into Chk2
  142.   put item 1 of dialogValue(500,13) into CtrlVal
  143.   put RadBtnChoosen after line 4 of cd fld 2
  144.   put Chk1 after line 5 of cd fld 2
  145.   put Chk2 after line 6 of cd fld 2
  146.   put CtrlVal after line 7 of cd fld 2
  147.   show cd fld 2
  148. end Get_result
  149.  
  150.  
  151.  
  152. -- part 3 (button)
  153. -- low flags: 00
  154. -- high flags: A002
  155. -- rect: left=23 top=53 right=75 bottom=123
  156. -- title width / last selected line: 0
  157. -- icon id / first selected line: 0 / 0
  158. -- text alignment: 1
  159. -- font id: 0
  160. -- text size: 12
  161. -- style flags: 0
  162. -- line height: 16
  163. -- part name: Help Me !
  164. ----- HyperTalk script -----
  165. on mouseUp
  166.   set lockscreen to true
  167.   if the visible of card field 1 is false then
  168.     show card field 1
  169.     set the name of the target to "Hide it!"
  170.     repeat with i is 3 to 10
  171.       show card button i
  172.     end repeat
  173.   else
  174.     hide card field 1
  175.     set the scroll of card field 1 to 0
  176.     set the name of the target to "Help Me !"
  177.     repeat with i is 3 to 10
  178.       hide card button i
  179.     end repeat
  180.   end if
  181. end mouseUp
  182.  
  183.  
  184.  
  185. -- part 4 (button)
  186. -- low flags: 80
  187. -- high flags: A004
  188. -- rect: left=23 top=109 right=131 bottom=123
  189. -- title width / last selected line: 0
  190. -- icon id / first selected line: 0 / 0
  191. -- text alignment: 1
  192. -- font id: 0
  193. -- text size: 12
  194. -- style flags: 0
  195. -- line height: 16
  196. -- part name: ModDialog
  197. ----- HyperTalk script -----
  198. on mouseUp
  199.   set the scroll of card field 1 to 549
  200. end mouseUp
  201.  
  202.  
  203.  
  204. -- part 5 (button)
  205. -- low flags: 80
  206. -- high flags: A004
  207. -- rect: left=23 top=155 right=177 bottom=123
  208. -- title width / last selected line: 0
  209. -- icon id / first selected line: 0 / 0
  210. -- text alignment: 1
  211. -- font id: 0
  212. -- text size: 12
  213. -- style flags: 0
  214. -- line height: 16
  215. -- part name: DisDialog
  216. ----- HyperTalk script -----
  217. on mouseUp
  218.   set the scroll of card field 1 to 1770
  219. end mouseUp
  220.  
  221.  
  222.  
  223. -- part 6 (button)
  224. -- low flags: 80
  225. -- high flags: A004
  226. -- rect: left=23 top=132 right=154 bottom=123
  227. -- title width / last selected line: 0
  228. -- icon id / first selected line: 0 / 0
  229. -- text alignment: 1
  230. -- font id: 0
  231. -- text size: 12
  232. -- style flags: 0
  233. -- line height: 16
  234. -- part name: HandleDialog
  235. ----- HyperTalk script -----
  236. on mouseUp
  237.   set the scroll of card field 1 to 1405
  238. end mouseUp
  239.  
  240.  
  241.  
  242. -- part 7 (button)
  243. -- low flags: 80
  244. -- high flags: A004
  245. -- rect: left=23 top=201 right=223 bottom=123
  246. -- title width / last selected line: 0
  247. -- icon id / first selected line: 0 / 0
  248. -- text alignment: 1
  249. -- font id: 0
  250. -- text size: 12
  251. -- style flags: 0
  252. -- line height: 16
  253. -- part name: SetDialog
  254. ----- HyperTalk script -----
  255. on mouseUp
  256.   set the scroll of card field 1 to 2382
  257. end mouseUp
  258.  
  259.  
  260.  
  261. -- part 8 (button)
  262. -- low flags: 80
  263. -- high flags: A004
  264. -- rect: left=23 top=178 right=200 bottom=123
  265. -- title width / last selected line: 0
  266. -- icon id / first selected line: 0 / 0
  267. -- text alignment: 1
  268. -- font id: 0
  269. -- text size: 12
  270. -- style flags: 0
  271. -- line height: 16
  272. -- part name: DialogValue
  273. ----- HyperTalk script -----
  274. on mouseUp
  275.   set the scroll of card field 1 to 1926
  276. end MouseUp
  277.  
  278.  
  279.  
  280.  
  281. -- part 9 (button)
  282. -- low flags: 80
  283. -- high flags: A004
  284. -- rect: left=23 top=224 right=246 bottom=123
  285. -- title width / last selected line: 0
  286. -- icon id / first selected line: 0 / 0
  287. -- text alignment: 1
  288. -- font id: 0
  289. -- text size: 12
  290. -- style flags: 0
  291. -- line height: 16
  292. -- part name: ParamDialog
  293. ----- HyperTalk script -----
  294. on mouseUp
  295.   set the scroll of card field 1 to 2754
  296. end MouseUp
  297.  
  298.  
  299.  
  300. -- part 27 (button)
  301. -- low flags: 80
  302. -- high flags: A004
  303. -- rect: left=23 top=270 right=292 bottom=123
  304. -- title width / last selected line: 0
  305. -- icon id / first selected line: 0 / 0
  306. -- text alignment: 1
  307. -- font id: 0
  308. -- text size: 12
  309. -- style flags: 0
  310. -- line height: 16
  311. -- part name: Skeleton╔
  312. ----- HyperTalk script -----
  313. on mouseUp
  314.   set the scroll of card field 1 to 3536
  315. end MouseUp
  316.  
  317.  
  318.  
  319. -- part 32 (button)
  320. -- low flags: 80
  321. -- high flags: A004
  322. -- rect: left=23 top=247 right=269 bottom=123
  323. -- title width / last selected line: 0
  324. -- icon id / first selected line: 0 / 0
  325. -- text alignment: 1
  326. -- font id: 0
  327. -- text size: 12
  328. -- style flags: 0
  329. -- line height: 16
  330. -- part name: ModifyItem
  331. ----- HyperTalk script -----
  332. on mouseUp
  333.   set the scroll of card field 1 to 3248
  334. end MouseUp
  335.  
  336.  
  337.  
  338. -- part 36 (button)
  339. -- low flags: 00
  340. -- high flags: A002
  341. -- rect: left=23 top=80 right=102 bottom=123
  342. -- title width / last selected line: 0
  343. -- icon id / first selected line: 0 / 0
  344. -- text alignment: 1
  345. -- font id: 0
  346. -- text size: 12
  347. -- style flags: 0
  348. -- line height: 16
  349. -- part name: About╔
  350. ----- HyperTalk script -----
  351. on mouseUp
  352.   if the visible of cd fld 1 is true then
  353.     set the scroll of cd fld 1 to 0
  354.     exit to hypercard
  355.   end if
  356.   ModDialog 505,Geneva,9,H
  357.   if the result is not empty then exit to hypercard
  358.   repeat
  359.     get HandleDialog(505)
  360.     if it is 1 then exit repeat
  361.   end repeat
  362.   DisDialog 505
  363. end mouseUp
  364.  
  365.  
  366.  
  367. -- part 52 (field)
  368. -- low flags: 81
  369. -- high flags: 0004
  370. -- rect: left=54 top=160 right=270 bottom=491
  371. -- title width / last selected line: 0
  372. -- icon id / first selected line: 0 / 0
  373. -- text alignment: 1
  374. -- font id: 3
  375. -- text size: 9
  376. -- style flags: 0
  377. -- line height: 12
  378. -- part name: resultat
  379. ----- HyperTalk script -----
  380. on MouseUp
  381.   hide me
  382.   put empty into last word of line 4 of me
  383.   put empty into last word of line 5 of me
  384.   put empty into last word of line 6 of me
  385.   put empty into last word of line 7 of me
  386. end MouseUp
  387.  
  388.  
  389.  
  390. -- part contents for card part 1
  391. ----- text -----
  392. These externals are ┬⌐ 89, Antoine Latour. They are free, and your are allowed to  distribute them in public domain products, if the line : "Externals ModDialog, DisDialog, HandleDialog, SetDialog, DialogValue & ParamDialog are ┬⌐ 89, Antoine Latour" appears clearly in your stacks. For any commercial products, please contact me at the following adress :
  393. Antoine Latour, 11, rue du Mai 1945, 91150 Etampes, France.
  394. Others contact : AppleLink TECH.SUPT.FR (Atn A.LATOUR), CalvaCom AA49.
  395.  
  396. In order to use dialogs in Hypercard stacks, i've implemented larges parts of the dialog manager in these six externals :
  397. ΓÇó ModDialog, which bring up a dialog window on the screen;
  398. ΓÇó DisDialog, which dispose it;
  399. ΓÇó HandleDialog, which return you the item choosen by the user;
  400. ΓÇó DialogValue, which return the value or the state of an item of the dialog item list;
  401. ΓÇó SetDialog, which allow you to change the state or the value of an item of the dialog item list;
  402. ΓÇó ParamDialog, which allow you to change the text displayed by a dialog.
  403. ΓÇó ModifyItem, which allow you to change the face of an item of the ditl list.
  404.  
  405. To use these commands, you need a good knowledge of the dialog manager of the Macintosh. See Inside Macintosh Vol I and III.
  406.  
  407. The first thing you've to do is to design your dialog. You can use ResEdit, Rmaker or other software to create them. If you use ResEdit, create a new file, then create a new DLOG resource. Warning : the visible attribute may be set to FALSE, RefCon may be set to 0. All other attributes, in particular GoAwayFlag, may be set to false. 
  408. Once your dialog is designed, with it's item list, you've to note carrefully :  the ID number of the DLOG, and the item number of all of the items. Usually, item 1 may be the OK button of the dialog.
  409. Then, you've to past the DLOG, the DITL, and all other associated resources ( PICT, ICON, etc.. ) into your stack.
  410.  
  411. ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   Modialog   ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   
  412.  
  413. The ModDialog XCMD display a dialog on the screen, with a variety of options, depending of the parameter specifieds.
  414. The simpliest way to call ModDialog is :
  415.  
  416.                     ModDialog [ID]
  417.  
  418. where ID is the dialog resource number. In this case, ModDialog display the dialog centered on the hyperCard screen. 
  419.  
  420. You can also add a second parameter, the H letter, like this :
  421.  
  422.                     ModDialog [ID],H
  423.  
  424. In this case, ModDialog display the dialog centered on the screen, and draw a round-rect around the first item of the dialog item list. It is usefull to show the user that typing Enter ou Return is equivalent to click in this item. In general, the first item is a button, Ok or Cancel.
  425.  
  426. You can also ask ModDialog to put the dialog at a particular location on the screen. To do that, type :
  427.             
  428.                 ModDialog [ID],[left],[top]
  429.  
  430. where left and top are two integers relatives to the card, where the topLeft corner of the dialog will take place.
  431.  
  432. In addition, you can ask ModDialog to put the dialog where you want, and to draw the round-rect around item #1:
  433.  
  434.               ModDialog [ID],[left,[top],H
  435.  
  436. ModDialog allows you to set the font and size of the static or editable text of the DITL. For that, you've to specify the name of the font you want to use, and its size :
  437.  
  438.                ModDialog [ID],[font],[size]
  439. In this case, the dialog will be centered on the screen. You can also ask, in addition, to have the first item hilited :
  440.             
  441.               ModDialog [ID],[font],[size],H
  442.  
  443. At least, you can also ask ModDialog to display the dialog wherever you want on the screen, with the first item hilited and a specific font and size used :
  444.  
  445.         ModDialog [ID],[left],[top],H,[font],[size]
  446.  
  447. Attention : the order of the specified parameter is important. All other order for them will cause the display of an error message : 'bad parameter'.
  448.  
  449. When you use ModDialog, anyway, some errors messages may occurs. First, if the specified dialog can't be found, ModDialog will notice you 'resource not found'. If the specified dialog still exist, ModDialog answer 'this dialog still exist'. 
  450. If all goes right, the result will be empty. You've not to store any pointer in any global. The only way to specify of what dialog you're speaking is the ID number of the dialog. Once the dialog displayed, you'll be use this ID to call others Xcmd of this set. I recommend to
  451. store this ID in a global variable, like in the following examples.
  452.  
  453. ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó HandleDialog ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   
  454.  
  455. HandleDialog is a function that return the item number choosen by the user. Its a one-event function. In most cases, you must call HandleDialog along a repeat loop, and you will exit this loop when the 'OK' or 'Cancel' button will be choose. HandleDialog return an integer, between 1 and 64 ( the maximum number of items in a DITL ). 
  456.  
  457. Example :
  458.  
  459. on Test_Dialog
  460.     global MyDlogID
  461.     repeat
  462.         put HandleDialog(MyDlogID) into UserAnswer
  463.         if UserAnswer is 1 then -- OK Button
  464.           exit repeat
  465.         else if UserAnswer is 2 then -- Cancel button
  466.           exit to HyperCard
  467.         end if
  468.     end repeat
  469.     -- here is the script wich look for the value of   
  470.     -- differents items. After that, you have to use 
  471.     -- DisDialog to put away the dialog
  472. end Test_Dialog
  473.  
  474. NOTE : Only enabled items can be seen by ModDialog. See your DITL with resEdit to Enable ou disable your item.
  475.  
  476. ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó DisDialog ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   
  477.  
  478.  
  479. Giving a ID of a dialog, DisDialog release it off the screen, releasing also the memory occupied by the dialog and item list structures.
  480.  
  481. Example :
  482.     On Bring_off_dialog
  483.         Global MyDlogID
  484.         DisDialog MyDlogID
  485.     end Bring_off_dialog
  486.  
  487. ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó DialogValue ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   
  488.  
  489.  
  490. Giving a Id of a previously displayed dialog, and an item number of the item list, DialogValue return you the value, or the state of this item, depending of what kind of item you're speaking about, and the type of this item. 
  491. If the item is a check-box, a radio-button or a control item ( scroll bar, etc..) dialogValue will return you its value ( O or 1 for radio-buttons and check-boxes, 0..255 for others ); If the item is a button, a staticText, or an editable text, dialogValue will return you the title or the content of this control. In all cases, DialogValue will return you a second value, separated from the first by a comma, which give you the type of the control, as follow : 'BtnItem' ( buttons ) , 'ChkItem' ( check-boxes ), 'RadBtn' ( radio-buttons ), 'EditText' ( editable text ), 'StaticText' (static text ), 'IconItem' ( icons ), 'PicItem' (pictures) 'CntrlItem' ( others controls ) or 'Unknown'.
  492.  
  493. Example :
  494.  
  495.     On What_Value
  496.         global MyDlogID
  497.         put DialogValue (MyDlogID,1) into ValueOfFirstItem
  498.         put DialogValue (MyDlogID,2) into ValueOfSecondItem
  499.     end What_Value
  500.  
  501.  In these examples, you may be returned :
  502.   "1,RadBtn" : a selected radio-button;
  503.   "0,ChkBox" : a non-selected check-box
  504.   "Hello,StaticText : the content of a static text
  505.   ",PicItem" : a picture ( nothing to read ) 
  506.  
  507.  
  508. ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó SetDialog ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   
  509.  
  510.  
  511. Given a ID of a dialog, and an item number of the item list, SetDialog will set a value or a state to the item, depending of what king of item you're speaking about. If the <Item> is a check-box or a radio-button, SetDialog will set the item to highlighed or not. In this case, you will use 1 or 0 in the third parameter, with 1 to highligh to item. If the <item> is a control item, you can pass values between 0 and 255. If the <item> is a static-text, editable-text, or a button, SetDialog will set the test of this item to [value], which is a sample string. Only first 255 caracters will be used.
  512.  
  513.  
  514. Examples :
  515.  
  516.   On Set_Item
  517.      -- set a checkbox ( item 3 of the DITL ) to on
  518.      global MyDlogID
  519.      SetDialog MyDlogID,3,1
  520.   end Set_Item
  521.  
  522.   on Set_Item
  523.      -- set a static-text ( item 3 of the DITL ) to a string
  524.      global MyDlogID
  525.      SetDialog MyDlogID,3,"Hello,World !"
  526.   end Set_Item
  527.  
  528. ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó ParamDialog ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   
  529.  
  530. ParamDialog provides a means of substituting text in statText items: Text1 through Text3 will replace the special strings '^0' through '^3' in all statText items in subsequent dialog, notified in the <pointer> parameter. Pass empty strings for parameters not used.
  531.  
  532. Example :
  533.  
  534.    on ParamText
  535.      global MyDlogID
  536.      ParamDialog MyDlogID,"first text","second text",&┬¼
  537.      "third text","fourth text"
  538.    end ParamText
  539.  
  540. If you want to put only the third line :
  541.        ParamDialog MyDlogID,"","","third texte",""
  542.  
  543. NOTE : you must specify the four text parameter, empty or not; If you want to change only one of the four lines, you must pass the full four line as parameter :
  544.  
  545.    on ParamText
  546.      global MyDlogID
  547.      ParamDialog MyDlogID,"first text","second text",&┬¼
  548.      "third text","fourth text"
  549.      wait 3 seconds
  550.      ParamDialog MyDlogID,"first text",&┬¼
  551.      "second text changed","third text","fourth text"
  552.    end ParamText
  553.  
  554. ATTENTION :  In this version, any call to ParamDialog on a dialog using a specific font and size will transform this fonte into Chicago 12, the system font. For any dialog that could be changed by a call to ParamDialog or SetDialog ( see above ), i do not recommend to use a font and size specification during the modDialog call.
  555.  
  556.  
  557.  
  558.  ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó ModifyItem ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó   
  559.  
  560. Given a ID on a previously displayed dialog, ModifyItem allow to to hide or show any item of the ditl, and to make any button or text gray-dimmed or back to black.
  561. For this four function, you've to spedify the dlog considered, the number of the items you want to modify, and the state you want for it, like this :
  562.  
  563.            ModifyItem [ID],[item],[state]
  564.  
  565. Where that is an integer beetwen 1 and 4 ( all others values are rejected ). 
  566. 1 make the control visible, 2 make the control unvisible, 3 make the control gray-dimmed and non selectable, 4 make the control black and selectable.
  567.  
  568. You can mix all of this values in succesives calls to ModifyItem. You can, for instance, ask ModifyItem to make your control gray-dimmed after have ask hil to make your control invisible. Once you've call it to make your control visible, it'll appears in gray.
  569.  
  570.  
  571.  ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó A script Skeleton ΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇóΓÇó
  572.  
  573. During the repeat ... HandleDialog ... end repeat loop, user may click in check-boxes or radio-button. If there is more of 2 radio-button in a group, you must switch off all radio-buttons first, then highligh the radio-button the user choose. I recommend to use this kind of script :
  574.  
  575.    On Display_Dialog
  576.      global MyId
  577.      put 500 into MyID
  578.      -- Display the dialog first
  579.      ModDialog MyID
  580.      
  581.      -- In this dlog, there is two distincts group of   
  582.      -- radio- button, and a group of 2 check-boxes. Only    
  583.      -- one of  radio-button of each group must be --
  584.      -- highligh. We create two series of radio-button :
  585.      -- item number of the radio-btn of first group :
  586.      put "3,4,5" into RadButtons1
  587.      -- item numbers of the radio-btn of second group :
  588.      put "6,7,8" into RadButtons2
  589.  
  590.      -- item numbers of the two check-boxes :
  591.      put "9,10" into CheckBoxes
  592.  
  593.      -- repeat loop
  594.      repeat
  595.       put HandleDialog(MyID) into userClic
  596.      if userClic is in RadButtons1 then
  597.        -- user clic in first group of radio-buttons
  598.        -- first, switch off all these radio-buttons :
  599.        repeat with i is 3 to 5
  600.          SetDialog MyID,i,0
  601.        end repeat
  602.        -- then we highligh the radio-button choosen
  603.        SetDialog MyID,UserClic,1
  604.       end if
  605.       if userClic is in RadButtons2 then
  606.        -- user clic in second group of radio-buttons
  607.        -- first, switch off all these radio-buttons :
  608.        repeat with i is 6 to 8
  609.          SetDialog MyID,i,0
  610.        end repeat
  611.        -- then we highligh the radio-button choosen
  612.        SetDialog MyID,UserClic,1
  613.       end if
  614.       if userClic is in CheckBoxes
  615.         -- user clic in a check-boxe. Is it actually
  616.         -- highligh or not ?
  617.         if DialogValue(MyID,UserClic) is O then
  618.           -- not hilight, so we select it
  619.           SetDialog MyID,UserClic,1
  620.          else
  621.           -- if it's highlighed, we switch it off
  622.          SetDialog MyID,UserClic,0
  623.        end if
  624.      end if
  625.      if userClic is 1 then exit repeat -- ok button
  626.    end repeat
  627.   -- Here is the script wich allow us to see what's button a   
  628.   -- selected :
  629.   repeat with i is 3 to 5
  630.    if DialogValue(MyID,i) is 1 then
  631.      put i into FirstGroupChoice
  632.    end if
  633.   end repeat
  634.   repeat with i is 6 to 8
  635.    if DialogValue(MyID,i) is 1 then
  636.     put i into SecondGroupChoice
  637.    end if
  638.   end repeat
  639.  
  640.   -- Now, the item number of each radio-button group
  641.   -- currently selected are stored in the variables
  642.   -- 'firstGroupChoice' and 'SecondGroupChoice'
  643.   -- Look for the checkBoxes
  644.   if DialogValue(MyID,9) is 1 then put true into ┬¼
  645.   FirstBox
  646.   if dialogValue(MyID,10) is 1 the put true into ┬¼  
  647.   SecondBox
  648.  
  649.   -- Now, we dispose the dialog :
  650.   DisDialog MyID
  651. end Display_dialog
  652.  
  653. See the script of card button 'Let's try' of this stack for more infos.
  654. I apologize for my 'non-fluent' english. But why don't you speak french as everybody does ?
  655. ΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇôΓÇô
  656. Evolutions of th differents versions :
  657. 1.6 : First diffused.
  658. 1.7 : Add of ActiveItem,HideItem,ShowItem commands.
  659. 1.8 : ModDialog display the dialog everywhere on the screen.
  660. 2.0 : ModDialog can draw a round-rect around the first item,
  661.       auto-center the dialog, and set the font and size of
  662.       static and editables texts.
  663.  
  664. ┬⌐ 89 Antoine Latour
  665.  
  666. -- part contents for card part 52
  667. ----- text -----
  668.  
  669. Your choices :
  670.  
  671. the radio-control choosen was the number 
  672. the first check-box was 
  673. and the second was 
  674. the scroll bar was set to 
  675.  
  676. click on this field to hide it.